//
//  QRCodeScanViewController.h
//  JST
//
//  Created by 蔡正军 on 15/7/13.
//  Copyright (c) 2015年 aniuge. All rights reserved.
//

#import <AVFoundation/AVFoundation.h>
#import "ZXingObjC.h"
#import "QRCodeService.h"

@class ScanQRCodeController;

@protocol ScanQRCodeControllerDelegate <NSObject>

@optional
- (void)ScanQRCodeController:(ScanQRCodeController *)controller didScanResult:(NSString *)result;
- (void)ScanQRCodeControllerDidCancel:(ScanQRCodeController *)controller;

@end

@interface QRCodeScanViewController : BaseClassController<UIAlertViewDelegate,UINavigationControllerDelegate,UIImagePickerControllerDelegate,AVCaptureMetadataOutputObjectsDelegate,AVCaptureVideoDataOutputSampleBufferDelegate,ZXCaptureDelegate,QRCodeServiceDelegate>

@property (nonatomic, assign) id<ScanQRCodeControllerDelegate> delegate;


@property (nonatomic, strong) UIButton *cancelButton;
@property (nonatomic, strong) UIButton *flashlightButton;
@property (nonatomic, strong) UIButton *photoLibraryButton;
@property (nonatomic, assign) BOOL isScanning;

@property (strong,nonatomic)AVCaptureDevice * device;
@property (strong,nonatomic)AVCaptureDeviceInput * input;
@property (strong,nonatomic)AVCaptureMetadataOutput * output;
@property (strong,nonatomic)AVCaptureSession * session;
@property (strong,nonatomic)AVCaptureVideoPreviewLayer * preview;

//退款
@property (nonatomic, assign) BOOL isFromRefund;
- (void)receiveObject:(void(^)(id object))sendObject;

@end
